<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
        <link href="/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="/css/style.css"/>       
        <link rel="stylesheet" href="/assets/css/ace.min.css" />
        <link rel="stylesheet" href="/assets/css/font-awesome.min.css" />
        <link rel="stylesheet" href="/Widget/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css" />
        <link href="/Widget/icheck/icheck.css" rel="stylesheet" type="text/css" />
	    <script src="/js/jquery-1.9.1.min.js"></script>   
        <script src="/assets/js/bootstrap.min.js"></script>
        <script src="/assets/js/typeahead-bs2.min.js"></script>
        <script type="/text/javascript" src="js/H-ui.js"></script> 
        <script type="/text/javascript" src="js/H-ui.admin.js"></script> 
        <script src="/assets/layer/layer.js" type="text/javascript" ></script>
        <script src="/assets/laydate/laydate.js" type="text/javascript"></script>
        <script type="/text/javascript" src="Widget/zTree/js/jquery.ztree.all-3.5.min.js"></script> 
        <script src="/js/lrtk.js" type="text/javascript" ></script>
<title>产品列表</title>
</head>
<body>
<div class=" page-content clearfix">
 <div id="products_style">
    <div class="search_style">
      <ul class="search_content clearfix">
       <li><label class="l_f">产品名称</label><input name="" type="text"  class="text_add" placeholder="输入品牌名称"  style=" width:250px"/></li>
       <li style="width:90px;"><button type="button" class="btn_search"><i class="icon-search"></i>查询</button></li>
      </ul>
    </div>
     <div class="border clearfix">
       <span class="l_f">
        <a href="picture-add.html" title="添加商品" class="btn btn-warning Order_form"><i class="icon-plus"></i>添加商品</a>
        <a href="javascript:ovid()" class="btn btn-danger"><i class="icon-trash"></i>批量删除</a>
       </span>
       <span class="r_f">共：<b>2334</b>件商品</span>
     </div>
     <!--产品列表展示-->
         <div class="table_menu_list" id="testIframe">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
				<th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="80px">产品编号</th>
				<th width="250px">产品名称</th>
				<th width="100px">单价</th>	
				<th width="180px">加入时间</th>                
				<th width="200px">操作</th>
			</tr>
		</thead>
	<tbody>
	<c:forEach items="${clist }" var="list">
     <tr>
        <td width="25px"><label><input type="checkbox" class="ace" ><span class="lbl"></span></label></td>
        <td width="80px">${list.commodityId }</td>               
        <td width="250px">${list.commodityName }</td>
        <td width="100px">${list.price }</td>         
        <td width="180px"><fmt:formatDate value="${list.launchTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
        <td class="td-manage">
        <a title="编辑" onclick="member_edit('编辑','member-add.html','4','','510')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
        <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
       </td>
	  </tr>
	  </c:forEach>
    </tbody>
    </table>
    </div>     
  </div>
 </div>
  <div class="page-icon">
		<c:set var="startNum" value="${p.current-5<1?1:p.current-5 }" />
		<c:set var="endNum"
			value="${p.current+5>p.getPages()? p.getPages():p.current+5 }" />
		<c:if test="${p.current!=1 }">
			<a href="javascript:void(0);" data-page="1" class="page-disabled">第一页</a>
		</c:if>
		<c:forEach begin="${startNum }" end="${p.getPages() }" var="i">
			<a href="javascript:void(0);" data-page="${i }">${i }</a>
		</c:forEach>
		<c:if test="${p.current!=p.getPages() }">
			<a href="javascript:void(0);" data-page="${p.getPages() }"
				class="page-next">最后一页</a>
		</c:if>
	</div>
	<script type="text/javascript"> 
	var pageList = document.querySelector(".page-icon").querySelectorAll("a[data-page]"); 
	console.info(pageList); 
	for(let item of pageList){ 
		console.info(item); 
		item.onclick = function(){ 
			let pNum = item.dataset.page;//获取a标签的data-page 
			let url = new URL(location.href); 
			url.searchParams.set("current",pNum); 
			location=url.toString(); 
			} 
		}
	</script>
</body>
</html>
